#!/bin/sh
echo '解压tar包...'
tar -zxvf /opt/software/docker-20.10.9.tgz -C /opt/module/
 
echo '将docker目录移到/usr/bin目录下...'
cp /opt/module/docker/* /usr/bin/
 
echo '将docker.service 移到/etc/systemd/system/ 目录...'
cp /tmp/script/docker.service /etc/systemd/system/
 
echo '添加文件权限...'
chmod +x /etc/systemd/system/docker.service
 
echo '重新加载配置文件...'
systemctl daemon-reload
 
echo '启动docker...'
systemctl start docker
 
echo '设置开机自启...'
systemctl enable docker.service
 
echo 'docker安装成功...'
docker -v

echo '添加docker-compose文件权限...'
chmod a+x /tmp/script/docker-compose

echo '将docker-compose 移到/usr/local/bin/ 目录...'
cp /tmp/script/docker-compose /usr/local/bin/

echo 'docker-compose安装成功...'
docker-compose --version